<!DOCTYPE html>
<html lang="en">
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
			name="viewport">
		<meta charset="UTF-8">
		<title>合肥婚纱摄影-合肥婚纱照-合肥金夫人集团官网</title>
		<meta content="telephone=no" name="format-detection" />
		<meta content="no-cache" http-equiv="pragma">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" href="/public/css/amazeui.min.css">
		<link rel="stylesheet" href="/public/css/jquery.bxslider.css">
		<link rel="stylesheet" href="/public/css/style.css">
		<link rel="stylesheet" href="/public/css/index.css">
		<link href="/public/css/animate.css" rel="stylesheet" />
		<link href="/public/css/nav.css" rel="stylesheet" />
		<link href="/public/css/modify2.css" rel="stylesheet" />

		<script src="/public/js/jquery.js"></script>
		<script src="/public/js/vue.js"></script>
		<!-- 引入element样式 -->
		<link href="/public/css/element.min.css" rel="stylesheet" />
		<!-- 引入element组件库 -->
		<script src="/public/js/element.min.js"></script>
		<script src="/public/js/axios.min.js"></script>
	</head>
	
	<body id="body-wrap">
		<!--main-->
		<link href="/public/css/product.css" rel="stylesheet" />
		<div class="product am-nbfc" id="caseVue">
			<header id="layout-header">
				<nav class="index-nav" id="index-nav">
					<ul class="m-1200 ul-list">
						<li class="nli ">
							<a href="/api/front/qianduan/index" class="n-a">
								<p class="nli-p">首页</p>
								<span class="nli-span">Home</span>
							</a>
						</li>

						<li class="nli ">
							<a href="/api/front/qianduan/custom" target="_self"
							   class="n-a">
								<p class="nli-p">客片赏析</p>
								<span class="nli-span">GuestPhoto</span>
							</a>
						</li>
						<li class="nli active">
							<a href="/api/front/qianduan/case" target="_self"
							   class="n-a">
								<p class="nli-p">风格大赏</p>
								<span class="nli-span">ModelPhoto</span>
							</a>
						</li>
						<li class="nli ">
							<a href="/api/front/qianduan/user" target="_self"
							   class="n-a">
								<p class="nli-p">个人中心</p>
								<span class="nli-span">PersonalCenter</span>
							</a>
						</li>
					</ul>
				</nav>
			</header>
			<section class="am-nbfc">
				<div class="slider-top location-slider">
					<el-carousel height="640px">
						<el-carousel-item v-for="(item,index) in bannerList" :key="item.id">
							<img :src="httpImgUrl+item.imgurl" style="width: 100%;"/>
						</el-carousel-item>
					</el-carousel>
				</div>

			</section>
			<!--风格分类-->

			<section class="am-nbfc">
				<img class="pro-logo" src="/public/images/sample-t.png" alt="">
				<div class="product-content">
					<ul class="product-l am-avg-md-4 am-thumbnails" id="product-wrap">
						<li v-for="item in fenggeList" :key="item.id">
							<div class="am-thumbnail product-i">
								<a href="" target="_self">
									<img :src="httpImgUrl+item.imgurl" alt="">
								</a>
								<div class="product-i-msg" style="display: flex;justify-content: space-between;align-items: center;">
									<h4 class="margin-0" style="flex: 1;margin-right: 10px;">{{item.name}}</h4>
									<el-button @click="yuyuePost(item.id)" type="primary" size="small">立即预约</el-button>
								</div>
							</div>
						</li>
						
					</ul>
				</div>

			</section>
			
			<el-dialog title="预约" :visible.sync="openZc" width="460px" append-to-body :close-on-click-modal="false" class="lvs_dialog">
				<el-form :model="formZc" :rules="rulesZc" ref="addZcForm" label-position="right"  :inline="true" label-width="100px">
					<el-form-item label="预约日期：" prop="yydate">
						<el-date-picker
						v-model="formZc.yydate" style="width: 300px;" value-format="yyyy-MM-dd"
						type="date"
						placeholder="选择日期">
						</el-date-picker>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="cancelZc">关 闭</el-button>
					<el-button type="primary" v-loading.fullscreen.lock="loading_post" @click="submitFormZc">立即预约</el-button>
				</div>
			</el-dialog>
			
		</div>
		

		<script src="/public/js/jquery.bxslider.js"></script>
		<script src="/public/js/style.js"></script>
		<script src="/public/js/service.js"></script>
		<script src="/public/js/index.js"></script>
		<script src="/public/js/slider.js"></script>
		<script src="/public/js/http.js"></script>

		<script>
			new Vue({
				el:'#caseVue',
				data:{
					loading_post:false,
					bannerList:[],
					fenggeList:[],
					httpImgUrl:httpImgUrl,
					openZc:false,
					formZc: {},
					rulesZc: {
						yydate: [{
							required: true,
							message: "预约日期不能为空",
							trigger: "blur"
						}]
					},	
				},
				created() {
					this.getList()
					this.getFengGe()
				},
				methods: {
					getList(){
						MyAxios.get('/api/front/lunbotu/list', {type:3}).then((response)=> {
							if(response.msgcode===0){
								this.bannerList=response.data
							}else{
								this.$message.error(response.msg);
							}
						})
						.catch(function (error) {
							this.$message.error(error);
						});
					},
					getFengGe(){
						MyAxios.get('/api/front/fenggedashan/list',{num:8}).then((response)=> {
							if(response.msgcode===0){
								this.fenggeList=response.data
							}else{
								this.$message.error(response.msg);
							}
						})
						.catch(function (error) {
							this.$message.error(error);
						});
					},
					yuyuePost(id){

						MyAxios.get('/api/front/appuser/getUserInfo').then((response)=> {
							if(response.msgcode===0){
								this.resetZc()
								this.openZc=true
								this.formZc.fgid=id
							}else if(response.msgcode===401){
								window.location.href='/api/front/qianduan/login'
							}else{
								this.$message.error(response.msg);
							}
						})
						.catch(function (error) {
							this.$message.error(error);
						});
						
					},
					cancelZc(){
						this.resetZc()
						this.openZc=false
					},
					resetZc(){
						this.formZc = {
							fgid:'',
							yydate:'',
						};
						this.resetForm("addZcForm");
					},
					resetForm(refName) {
						if (this.$refs[refName]) {
							this.$refs[refName].resetFields();
						}
					},

					submitFormZc(){
						this.$refs["addZcForm"].validate(valid => {
							if (valid) {
								this.loading_post=true
								MyAxios.post('/api/front/yuyue/order',this.formZc).then((response)=> {
									this.loading_post=false
									if(response.msgcode===0){
										this.openZc=false
										this.$message({
											message: response.msg,
											type: 'success',
											duration:1500,
										});
										
									}else{
										this.$message.error(response.msg);
									}
								})
								.catch(function (error) {
									this.loading_post=false
									this.$message.error(error);
								});
							}
						})
					},
				}
			})
		</script>
	</body>

</html>